<div class="bjui-pageContent">
    <table class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        gridTitle : '角色分配',
        {{--showToolbar: true,--}}
        {{--toolbarItem: 'edit,|,save,|,cancel',--}}
        local: 'local',
        dataUrl: '/admin/user/role-assignment',
        editUrl: '/admin/user/save-role-assignment',
        {{--showCheckboxcol: true,--}}
        linenumberAll: true,
        inlineEditMult: false,
        sortAll: false,
        contextMenuH: true,
        paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
        fieldSortable: false,
        filterThead: false,
        columnMenu: false,
        postData: {user_id:{{ $userId }}},
        showEditbtnscol: '操作',
        customEditbtns: {width:200,position:'replace',buttons:datagrid_tree_operation},
    }">
        <thead>
        <tr>
            <th data-options="{name:'name',align:'center',width:150,add:false,edit:false}">英文名</th>
            <th data-options="{name:'display_name',align:'center',width:150,add:false,edit:false}">中文名</th>
            <th data-options="{name:'description',align:'center',width:300,add:false,edit:false}">描述</th>
            <th data-options="{name:'permission',align:'center',width:100,type:'select',items:[{'1':'绑定'}]}">绑定</th>
        </tr>
        </thead>
    </table>
</div>

<script type="text/javascript">
    // 操作列
    function datagrid_tree_operation() {
        var html = ' <button type="button" class="btn btn-green bjui-datagrid-btn edit"><i class="fa fa-edit"></i> 编辑</button>'
                + ' <button type="button" class="btn btn-green bjui-datagrid-btn update"><i class="fa fa-edit"></i> 更新</button>'
                + ' <button type="button" class="btn btn-green bjui-datagrid-btn save"><i class="fa fa-check"></i> 保存</button>'
                + ' <button type="button" class="btn btn-orange bjui-datagrid-btn cancel"><i class="fa fa-undo"></i> 取消</button>'

        return html
    }
</script>